Attribute VB_Name = "modClientInit"
Option Explicit

'Initializes the client
Public Sub InitClient()
    Call SetStatus("Setting Global Vars")
    SEP_CHAR = Chr$(0)
    END_CHAR = Chr$(237)
    NameOfUser = vbNullString
    Call IncLoadBar
    
    Call SetStatus("Creating Files")
    If Not FileExists("config.ini") Then
        Call WriteINI("CONNECTION", "SERVERIP", CONNECTIP, _
        App.Path & "\config.ini")
        Call WriteINI("CONNECTION", "SERVERPORT", CONNECTPORT, _
        App.Path & "\config.ini")
    End If
    Call IncLoadBar
    
    Call SetStatus("Connecting To Server")
    Call Load(frmMainMenu)
    Call ConnectToServer
    Call IncLoadBar
    
    
    frmMainMenu.Show
    Call Unload(frmLoad)
End Sub

'Increases Status Bar Value By 1
Public Sub IncLoadBar()
    frmLoad.barLoadStatus.Value = frmLoad.barLoadStatus.Value + 1
End Sub

Public Sub SetStatus(text As String)
    frmLoad.lblLoadingStatus = text
End Sub

